<%@ page import="org.apache.jasper.runtime.HttpJspBase" %><%--
  Created by IntelliJ IDEA.
  User: 22954
  Date: 2024/8/30
  Time: 17:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>内置对象</title>
</head>
<body>
<%
    /*
    JSP的内置对象----已经创建好的对象,Tomcat转换jsp成为HttpJspBase后,类的属性包含的八大对象(exception已被废弃)
    1.out----PrintWriter out = resp.getWriter();
    2.request-----req
    3.response----resp
    4.session----HttpSession session = req.getSession();
    5.application----对应ServletContext
    6.pageContext----一个域对象,存储数据,作用域为当前页面(当前jsp)
    7.page----this,当前jsp成为HttpJspBase子类的实例本身
    8.config----对应ServletConfig
     */
    out.println("hello world");
    request.setAttribute("a", "AAA");
    //response.sendRedirect("https://www.baidu.com/");
    session.setAttribute("age", "18");
    application.setAttribute("age", "18");
    pageContext.setAttribute("age", "18");
    String string = page.toString();
    ServletContext servletContext = config.getServletContext();
%>
page:<%=string%><br/>
config.getServletContext:<%=servletContext%><br/>
</body>
</html>
